{extend name='admin@public/content'}
<style>
    .keys-container{min-width:800px}
    .keys-container textarea{width:95%;height:100px;border-radius:0}
    .keys-container .input-group input{border-right:0}
    .keys-container .input-group-addon{border-left:0;border-radius:0}
    .keys-container [data-tips-image]{width:112px;height:auto;}
    .keys-container .layui-elem-field{width:100%;height:100px;position:absolute}
</style>
{/block}
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" href="\static\layui\css\layui.css" media="all" />
</head>
{block name="content"}
<!-- 效果预览区域 结束 -->

<div class="row keys-container">
    <div class='col-xs-6 margin-left-15'>
        <form class="form-horizontal layui-form" role="form" data-auto="true" action="admin/adminshop/editPost" method="post">
            <fieldset style="width:120%;height:600px" class="layui-elem-field layui-box">
                <legend>{$title}</legend>
                <input type="hidden" value="{$info.id} " name='id'>
                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">店铺名称 </label>
                    <div class="col-xs-8">
                        <input maxlength='20' class="layui-input" value='{$info.sname|default="暂无"}' readonly='true'>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">项目名称</label>
                    <div class="col-xs-8">
                        <input required title='请输入价格' maxlength='20' name='money' class="layui-input" value='{$info.name|default=""}'>
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">类别</label>
                    <div class="layui-input-inline">
                        <select name="cid" class="layui-select">
                            <option value="">状态</option>
                            {foreach($info['class'] as $v)}
                            {if $info.cid eq $v.id}
                            <option selected="selected" value="{$v.id}">{$v.name}</option>
                            {else}
                            <option value="{$v.id}">{$v.name}</option>
                            {/if}
                            {/foreach}
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">详情内容</label>
                    <div class="col-xs-8">
                        <input required title='请输入详情内容' maxlength='20' name='content' class="layui-input" value='{$info.content|default=""}'>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">价格</label>
                    <div class="col-xs-8">
                        <input required title='请输入价格' maxlength='20' name='money' class="layui-input" value='{$info.money|default=""}'>
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">缩略图 </label>
                    <div class="col-sm-8">
                        <img data-tips-image="" style="height:auto;max-height:100px;min-width:100px" src='{$info.img|default=""}'>
                        <input type="hidden" name="browser_icon" onchange="$(this).prev('img').attr('src', this.value)" value="{$info.thumb}" class="layui-input">
                        <a class="btn btn-link" data-file="one" data-uptype="loca" data-type="ico,png,jpg" data-field="browser_icon">上传图片</a>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label label-required">状态</label>
                    <div class="col-xs-8">
                        <div class="mt-radio-inline padding-bottom-0">
                            <label class="think">
                                <!---->
                                <input data-auto-none="" type="radio" <?php if($info['status'] == 1){?>checked<?php }?> name="status" value="1"> 正常                                <!---->
                            </label>
                            <label class="think">
                                <!---->
                                <input data-auto-none="" type="radio"<?php if($info['status'] == 2){?>checked<?php }?> name="status" value="2"> 锁定                                <!---->
                            </label>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-2 control-label layui-form-label ">已售</label>
                    <div class="col-xs-8">
                        <span class="layui">{$info.soldnum|default="暂无"}</span>
                    </div>
                </div>
                <div class="text-center padding-bottom-10" style="position:absolute;bottom:0;width:100%;">
                    <div class="hr-line-dashed" style="margin:10px 0"></div>
                    <button style="" class="layui-btn menu-submit">保存数据</button>
                    <!--{if !isset($vo.keys) || !in_array($vo.keys,['default','subscribe'])}-->
                    <button data-cancel-edit class="layui-btn layui-btn-danger" type='button'>取消编辑</button>
                    <!--{/if}-->
                </div>
                {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'>{/if}
            </fieldset>
        </form>
    </div>
</div>
{/block}

<script charset="UTF-8" src="\static\layui\layui.js"></script>
{block name="script"}
<script>
    $(function (){
        var $body = $('body');
        /*! 取消编辑 */
        $('[data-cancel-edit]').on('click', function (){
            var dialogIndex = $.msg.confirm('确定取消编辑吗？', function (){
                history.back();
                $.msg.close(dialogIndex);
            });
        });
        // 默认事件触发
        $('input[name=type]:checked').map(function (){
            $(this).trigger('click');
        });
        window.laydate.render({range: true, elem: '#create_at'});
        window.form.render();
    });
</script>
{/block}
